﻿using RestSharp;
using System;
using System.Web;
using Ymatou.ServiceCenter;
using Ymatou.User.Dto.Auth;
using YmtAuth.AppService;
using YmtAuth.Domain.Shard;
using YmtSystem.CrossCutting;
using ResetService = ServiceStack.Service;

namespace YmtAuth.Web.Handlerv2
{
    
    public class LoginLimitHandler : ResetService
    {
        private IAuthQueryAppService AuthAppService { get { return LocalServiceLocator.GetService<IAuthQueryAppService>(); } }


        [ServiceRegister("/json/reply/LoginLimitRequestDto", Method.GET)]
        public object Get(LoginLimitRequestDto request)
        {
            HttpContext.Current.Request.Headers.Add(YmtUserKey.RequestId, Guid.NewGuid().ToString("N"));
            HttpContext.Current.Request.Headers.Add(YmtAuthSafeConstant.ApiId, YmtAuthSafeConstant.Api_login);

            return AuthAppService.GetLoginFailCount(request, Request);
        }
    }
}